#include <stdio.h>
#include <string.h>

int mycmp(const char* s1, const char* s2)
{
	while (*s1 == *s2 && *s1) {
		s1++;
		s2++;
	}
	return *s1 - *s2;
}

char* mycpy(char* dst, const char* src)
{
	char* ret = dst;
	while (*dst++ = *src++);
	return ret;
}

char* mycat(char* dst, const char* src) {
	char* ret = dst;
	while (*dst++);
	dst--;
	while (*dst++ = *src++);
	return ret;
}

int main()
{
	char s1[] = "abc";
	char s2[] = "abc ";
	char s3[223] = "";
	printf("%d\n", mycmp(s1, s2));
	printf("%d\n", 'a'-'A');
	mycpy(s3, s1);
	printf("=> %s\n", s3);

	char s[] = "hello";
	char* p = strchr(s, 'l');
	printf("%s\n", p);
	char* p2 = strchr(p+1, 'l');
	printf("%s\n", p2);
	mycat(s3, s);
	printf("=> %s\n", s3);
	return 0;
}